package com.sporadic.backstage.controller;

import com.alibaba.fastjson.JSON;
import com.sporadic.backstage.entity.Merchant;
import com.sporadic.backstage.service.MerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MerchantController {
    @Autowired
    private MerchantService merchantService;

    /**
     * 商家登陆
     * @param tel 电话
     * @param password 密码
     * @return json 商家信息
     */
    @ResponseBody
    @RequestMapping("/doLoginMerchant")
    public String doLoginMerchant(String tel ,String password){
        return JSON.toJSONString(merchantService.doLogin(tel, password));
    }
}
